<%-- 
    Document   : turnoverfood
    Created on : Dec 5, 2011, 5:31:47 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*, java.text.NumberFormat,Beans.ThamSoHT,Models.ThamSoHT_Model, Models.NhomMA_Model, Models.MonAn_Model, Models.TienTe_Model"%>
<!--
Danh sách các tham số hệ thống ở trang này :
order      areainfo     areamsg     status      arealang
newarea    areaname     save        action      arealist
enable     disable      search
-->

<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'order', 'foodgroups', 'reportdate', 'signature', 'authorizedofficer', 'departmentmanager', 'totalturnover', 'food', 'period', 'price', 'quantity', 'turnover', 'turnoverfood'";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.

            String authorizedofficer = mdsts[0].getTenTS();
            String departmentmanager = mdsts[1].getTenTS();
            String food = mdsts[2].getTenTS();
            String foodgroups = mdsts[3].getTenTS();
            String order = mdsts[4].getTenTS();
            String period = mdsts[5].getTenTS();
            String price = mdsts[6].getTenTS();
            String quantity = mdsts[7].getTenTS();
            String reportdate = mdsts[8].getTenTS();
            String signature = mdsts[9].getTenTS();
            String totalturnover = mdsts[10].getTenTS();
            String turnover = mdsts[11].getTenTS();
            String turnoverfood = mdsts[12].getTenTS();

            Vector v = (Vector) request.getAttribute("Report");
            String ngaybd = (String) request.getAttribute("ngaybd");
            String ngaykt = (String) request.getAttribute("ngaykt");
            String manhomma = (String) request.getAttribute("manhomma");
            String tenmonan = (String) request.getAttribute("tenmonan");
            String sl = (String) request.getAttribute("sl");
            String doanhthu = (String) request.getAttribute("doanhthu");
            String tendn = (String) request.getAttribute("tendn");
            String diachi = (String) request.getAttribute("diachi");
            String sodt = (String) request.getAttribute("sodt");
            String ngaygio = (String) request.getAttribute("ngaygio");
            NumberFormat nf = NumberFormat.getNumberInstance(Locale.FRENCH);
%>
<html>
    <head>
        <link href="css/statics.css" type="text/css" rel="stylesheet" />
        <title>i-Order</title>
        <link rel="icon" href="images/icon.png" />
        <link rel="shortcut icon" href="images/icon.png" />
        <link rel="apple-touch-icon" href="images/icon.png"/>
        <link rel="apple-touch-icon-precomposed" href="images/icon.png"/>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body style="background: none;">
        <div style=" width: 57%; background: #f5e3c0; margin-left: 260px; padding: 10px;">
        <div style=" " class="companystatics">
            <div style="text-align: left; text-transform: uppercase; font-size: 20px; margin-bottom: 10px; color: #242323; font-weight: bold;"><%=tendn%></div>
            <div style="text-align: left; margin-bottom: 5px; color: #242323;"><img style=" margin-right: 8px;" alt="" src="images/download2.png"><%=diachi%></div>
            <div style="text-align: left; color: #242323;"><img style=" margin-right: 5px;" alt="" src="images/phone.png"><%=sodt%></div>
        </div>
        <div style=" color: #906102; text-transform: uppercase; clear: both; font-size: 24px; margin-bottom: 15px;  font-weight: bold; text-align: center;"><%=turnoverfood%></div>
        <div class="content" style="">
            <table  style=" margin-bottom: 30px; margin-left: 235px;">
                
                <tr>
                    <td style=" width: 105px; color: #242323;"><%=period%> :</td>
                    <%  if(!ngaybd.equals("")){%>
                    <td style="color: #242323;"><%=ngaybd%>  -  <%=ngaykt%></td>
                    <%  }%>
                </tr>
                
                <tr>
                
                    <td style="color: #242323; width: 105px;"><%=foodgroups%> :</td>
                    <td style=" color: #242323;">
                        <%  if (!manhomma.equals("all")) {%>
                        <%=NhomMA_Model.LayTenNhomMA(Integer.parseInt(manhomma), langid)%>
                        <%  }%>
                    </td>
                </tr>
                <tr>
                    <td style="color: #242323; width: 105px;"><%=food%> :</td>
                    <%  if(!tenmonan.equals("")){%>
                    <td style="  color: #242323;"><%=tenmonan%></td>
                    <%  }%>
                </tr>
                <tr>
                    <td style="  color: #242323; width: 105px;"><%=quantity%> :</td>
                <%  if(!tenmonan.equals("")){%>
                    
                    <td style="  color: #242323;"><%=sl%></td>
                <%  }%>
                </tr>
            </table>
            <div style="padding: 20px; border: 1px solid #242323;  border-top:2px double #242323; border-bottom: 2px double #242323; ">
                <table id="tk" class="mytable" border="0" cellpadding="0" cellspacing="0" style=" margin-left: 5px;">
                    <thead>
                        <th style=" width: 8%; padding-left: 10px;" class="titlestaticss"><%=order%></th>
                        <th style=" width: 24%;" class="titlestaticss"><%=food%></th>
                        <th style=" width: 24%; padding-left: 25px;" class="titlestaticss"><%=price%>    (<%=TienTe_Model.LayKyHieuTT(langid)%>)</th>
                        <th style=" width: 20%;" class="titlestaticss"><%=quantity%></th>
                        <th style=" color: #242323; padding-right: 10px;" class="titlestaticss"><%=turnover%> (<%=TienTe_Model.LayKyHieuTT(langid)%>)</th>
                    </thead>
                    <%
                                for (int i = 0; i < v.size(); i++) {
                                    Beans.CTHoaDon cthd = (Beans.CTHoaDon) v.elementAt(i);
                    %>
                    <tr >
                        <td style="padding-left: 7px; padding-bottom: 5px;"><%=i + 1%></td>
                        <td style="padding-bottom: 5px;" ><%=MonAn_Model.LayTenMA(cthd.getMaMA(), langid)%></td>
                        <td style="padding-bottom: 5px;"><div style=" float: left; width: 90px; text-align: right; margin-right: 15px;"><%=nf.format(cthd.getGia())%></div></td>
                        <td style="padding-left: 25px; padding-bottom: 5px;"><%=cthd.getSoLuong()%></td>
                        <td style=" padding-bottom: 5px;"><div style=" float: left; width: 90px; text-align: right; margin-right: 15px;"><%=nf.format(cthd.getThanhTien())%></div></td>
                    </tr>
                    <%  }
                    %>
                    <tr>
                        <td style="background: #e5cb9a;"></td><td style="background: #e5cb9a;"></td><td style="background: #e5cb9a;"></td>
                        <td style="color: #242323; background: #e5cb9a; vertical-align: middle; height: 40px; font-weight: bold;"><%=totalturnover%>:</td>
                        <td style="color: #242323; background: #e5cb9a; vertical-align: middle; height: 40px; padding-left: 37px; font-weight: bold;"><%=nf.format(Double.parseDouble(doanhthu))%> <%=TienTe_Model.LayKyHieuTT(langid)%></td>
                    </tr>
                </table>
            </div>
                    <div style=" padding-top: 30px; background: #f5e3c0; height: 100px; padding-left: 5px; ">
                    <div style=" width: 300px; float: left;">
                    <label><%=reportdate%> :</label> <%=ngaygio%>
                </div>
                <div style=" width: 230px; float: left;">
                    <label><%=authorizedofficer%></label><br /><br />
                    <div style=" padding-left: 30px;"><%=signature%></div>
                </div>
                <div style="width: 150px; float: left;">
                    <label><%=departmentmanager%></label><br /><br />
                    <div style=" padding-left: 30px;"><%=signature%></div>
                </div>
                </div>
        </div>
                </div>
    </body>
</html>




